The present invention relates to an electronic control unit for a vehicle and to a data communication method.
An electronic control unit (ECU) for a vehicle is equipped with a nonvolatile memory (e.g., flash read only memory (ROM)) that is capable of erasing and writing data electrically. The electronic control unit controls in-vehicle units (e.g., fuel injector) by means of a control program or the like stored in the nonvolatile memory.
As disclosed in Japanese Laid-open Patent Application Publication No. 2008-146521, when data of a control program or the like is written into a nonvolatile memory, a writing tool, which transfers data to be written to an electronic control unit, is connected to the electronic control unit. Then, while transferring the data to be written from the writing tool to the electronic control unit, the electronic control unit writes the data to be written, into a nonvolatile memory.
The electronic control unit communicates with communication target units, using communication buffers different for each of the communication target units. Thus, when the electronic control unit receives the data to be written transferred by the writing tool, the electronic control unit can use only an assigned communication buffer for communication with the writing tool, and accordingly, size of data which can be received at once is restricted. Thus, for example, in a case of communication in which synchronization is performed in a manner in which every time the data is received from the writing tool, a response thereof is sent to the writing tool, the electronic control unit sends responses the same number of times as the data to be written is received. Accordingly, the number of times of the communication between the electronic control unit and the writing tool may be large, and this may be a cause of increased transfer time of the data to be written.